<html>
<head><meta charset="utf-8"><title>Looking for help on #53325 · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html">Looking for help on #53325</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210357230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210357230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210357230">(Sep 17 2020 at 07:45)</a>:</h4>
<p>Hello, everyone. I'm looking for help getting started on <a href="https://github.com/rust-lang/rust/issues/53325">#53325</a>. I see it's labelled <code>E-mentor</code> and <code>E-medium</code>. I've done only three PRs so far: Two for the test suite and one for error messages. Was looking to dive in deeper.</p>



<a name="210358424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358424">(Sep 17 2020 at 07:57)</a>:</h4>
<p>Oh wow, that issue is ancient <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span></p>



<a name="210358450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358450">(Sep 17 2020 at 07:57)</a>:</h4>
<p>But still as relevant as ever</p>



<a name="210358552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358552">(Sep 17 2020 at 07:58)</a>:</h4>
<p>I see it's labelled <code>P-low</code>, would there be a better issue to work on?</p>



<a name="210358605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358605">(Sep 17 2020 at 07:59)</a>:</h4>
<p>Oh that just means we don't look at it often during triage</p>



<a name="210358617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358617">(Sep 17 2020 at 07:59)</a>:</h4>
<p>I personally would love for this to finally get resolved</p>



<a name="210358646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358646">(Sep 17 2020 at 07:59)</a>:</h4>
<p>so... the cool thing is that printing the memory of an allocation is a single function call nowadays</p>



<a name="210358757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358757">(Sep 17 2020 at 08:00)</a>:</h4>
<p>So I guess we print it to a String and put that String into a <code>note</code> on the diagnostic</p>



<a name="210358800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358800">(Sep 17 2020 at 08:01)</a>:</h4>
<p>The harder part is to know which allocation to print, but maybe the validation error carries that?</p>



<a name="210358835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358835">(Sep 17 2020 at 08:01)</a>:</h4>
<p>hmm, doesn't look like it</p>



<a name="210358931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358931">(Sep 17 2020 at 08:02)</a>:</h4>
<p>So... step 1: Find out where that specific error is built (not emitted, but built in <code>rustc_mir/interpret/validation.rs</code>)</p>



<a name="210358986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210358986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210358986">(Sep 17 2020 at 08:03)</a>:</h4>
<p>step 2: add a <code>Pointer</code> field to that error</p>



<a name="210359111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359111">(Sep 17 2020 at 08:04)</a>:</h4>
<p>Mhmm, step 3, where it's emitted, add a note?</p>



<a name="210359477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359477">(Sep 17 2020 at 08:08)</a>:</h4>
<p>sorry, got a phone call</p>



<a name="210359517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359517">(Sep 17 2020 at 08:09)</a>:</h4>
<p>step 3: at the emitter site invoke <code>write_allocation_track_relocs</code> (may need to make that one public) to fill in a <code>String</code></p>



<a name="210359536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359536">(Sep 17 2020 at 08:09)</a>:</h4>
<p>then use that string to add a note to the diagnostic</p>



<a name="210359599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359599">(Sep 17 2020 at 08:10)</a>:</h4>
<p>Does that function exist?</p>



<a name="210359642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359642">(Sep 17 2020 at 08:10)</a>:</h4>
<p>yes, but it's private</p>



<a name="210359646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359646">(Sep 17 2020 at 08:10)</a>:</h4>
<p>let me check for a public wrapper, one moment</p>



<a name="210359677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359677">(Sep 17 2020 at 08:10)</a>:</h4>
<p>Thanks so much for all the help. It means a lot to me. <span aria-label="hearts" class="emoji emoji-2665" role="img" title="hearts">:hearts:</span>️</p>



<a name="210359719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359719">(Sep 17 2020 at 08:11)</a>:</h4>
<p>Ah no, you'll want <code>display_allocation</code></p>



<a name="210359807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359807">(Sep 17 2020 at 08:12)</a>:</h4>
<p>which gives you a formatter, so <code>display_allocation(tcx, allocation).to_string()</code>. This only gives you a single allocation, in the future we may print more, but let's start with just the allocation that we're blaming for things</p>



<a name="210359909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210359909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210359909">(Sep 17 2020 at 08:13)</a>:</h4>
<p>Okay. I'll start working on it in a few hours, and come back if I have any questions. <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span></p>



<a name="210360532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210360532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210360532">(Sep 17 2020 at 08:20)</a>:</h4>
<p>ok cool! yes please don't hesitate to ask anything!</p>



<a name="210481225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210481225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210481225">(Sep 18 2020 at 05:55)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> do you know which function this will hit in <code>valididty.rs</code>?</p>



<a name="210488507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210488507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210488507">(Sep 18 2020 at 07:55)</a>:</h4>
<p>so... I guess it's <a href="https://github.com/rust-lang/rust/blob/f3c923a13a458c35ee26b3513533fce8a15c9c05/compiler/rustc_mir/src/interpret/validity.rs#L509">https://github.com/rust-lang/rust/blob/f3c923a13a458c35ee26b3513533fce8a15c9c05/compiler/rustc_mir/src/interpret/validity.rs#L509</a> but I don't see how to inject an allocation there...</p>



<a name="210488619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210488619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210488619">(Sep 18 2020 at 07:56)</a>:</h4>
<p>There's this: <a href="https://github.com/rust-lang/rust/blob/f3c923a13a458c35ee26b3513533fce8a15c9c05/compiler/rustc_mir/src/interpret/validity.rs#L45">https://github.com/rust-lang/rust/blob/f3c923a13a458c35ee26b3513533fce8a15c9c05/compiler/rustc_mir/src/interpret/validity.rs#L45</a></p>
<p>But that's a lot more general. And it changes the ABI, not sure if that's okay.</p>



<a name="210488645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210488645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210488645">(Sep 18 2020 at 07:57)</a>:</h4>
<p>Should I add a <code>Pointer</code> to <code>ValidationFailure</code>?</p>



<a name="210488797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210488797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210488797">(Sep 18 2020 at 07:58)</a>:</h4>
<p>Yea that's what I'm thinking, too, but then you'll also have to pass it into every <code>throw_validation_failure</code> invocation</p>



<a name="210488820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210488820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210488820">(Sep 18 2020 at 07:59)</a>:</h4>
<p>maybe we can just do this at the validation site and report the <em>entire</em> constant instead of just the broken part</p>



<a name="210488837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210488837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210488837">(Sep 18 2020 at 07:59)</a>:</h4>
<p>though that won't give us the location that we could highlight</p>



<a name="210488849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210488849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210488849">(Sep 18 2020 at 07:59)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> ideas? Opinions?</p>



<a name="210489299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210489299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210489299">(Sep 18 2020 at 08:04)</a>:</h4>
<p>Perhaps an <code>Option&lt;Pointer&gt;</code>?</p>



<a name="210497438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210497438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210497438">(Sep 18 2020 at 09:42)</a>:</h4>
<p>Sure, we could start out with just improving the mentioned case and generalizing later</p>



<a name="210497663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210497663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210497663">(Sep 18 2020 at 09:45)</a>:</h4>
<p>I'd still like to hear from <span class="user-mention" data-user-id="120791">@RalfJ</span> before fiddling with the validator as he put a lot of design effort into that API</p>



<a name="210497740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210497740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210497740">(Sep 18 2020 at 09:46)</a>:</h4>
<p>(and I don't want to waste your time with going off on an implementation that we may have to throw away)</p>



<a name="210502350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210502350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210502350">(Sep 18 2020 at 10:46)</a>:</h4>
<p>(the issue description in <a href="https://github.com/rust-lang/rust/issues/53325">#53325</a> is really confusing as the issue got repurposed without updating the description^^)</p>



<a name="210503706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210503706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210503706">(Sep 18 2020 at 11:01)</a>:</h4>
<p>hm, on first sight it seems reasonable that <code>throw_validation_failure</code> would not just take the path information for locating the error in the value (type-driven), but also some way to locate the error in memory</p>



<a name="210503745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210503745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210503745">(Sep 18 2020 at 11:01)</a>:</h4>
<p>however, do we even always have memory? we are validating arbitrary <code>OpTy</code></p>



<a name="210503821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210503821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210503821">(Sep 18 2020 at 11:02)</a>:</h4>
<p>but maybe once <a href="https://github.com/rust-lang/rust/pull/74949">https://github.com/rust-lang/rust/pull/74949</a> finally lands we'll only have to validate in-memory things?</p>



<a name="210506215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506215">(Sep 18 2020 at 11:30)</a>:</h4>
<p>So it seems the consensus is "let's leave it as-is for now", right?</p>



<a name="210506242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506242">(Sep 18 2020 at 11:31)</a>:</h4>
<p>leave what as-is? not sure what the alternative plan is to adding a <code>Pointer</code>?</p>



<a name="210506290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506290">(Sep 18 2020 at 11:31)</a>:</h4>
<p>The issue. Or would you recommend adding a <code>Pointer</code>/<code>Option&lt;Pointer&gt;</code>?</p>



<a name="210506351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506351">(Sep 18 2020 at 11:32)</a>:</h4>
<p>The alternative is to not have an error location and just dump the constant's memory</p>



<a name="210506380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506380">(Sep 18 2020 at 11:32)</a>:</h4>
<p>not sure how amused users are if we tell them "uh sorry, due to impl constraints here's a memory dump for you to find your own problems in"</p>



<a name="210506446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506446">(Sep 18 2020 at 11:33)</a>:</h4>
<p>But I think this would be a reasonable start for any constants that are backed by memory</p>



<a name="210506447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506447">(Sep 18 2020 at 11:33)</a>:</h4>
<p>Especially when we have the information, even if not easily accessible.</p>



<a name="210506589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506589">(Sep 18 2020 at 11:35)</a>:</h4>
<p>So... bascially in <a href="https://github.com/rust-lang/rust/blob/f3c923a13a458c35ee26b3513533fce8a15c9c05/compiler/rustc_mir/src/const_eval/eval_queries.rs#L225">https://github.com/rust-lang/rust/blob/f3c923a13a458c35ee26b3513533fce8a15c9c05/compiler/rustc_mir/src/const_eval/eval_queries.rs#L225</a> you can grab the <code>RawConst</code> and get the <code>AllocId</code> from that</p>



<a name="210506628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506628">(Sep 18 2020 at 11:36)</a>:</h4>
<p>then you can use the printing we discussed and attach it as a note in <a href="https://github.com/rust-lang/rust/blob/f3c923a13a458c35ee26b3513533fce8a15c9c05/compiler/rustc_mir/src/const_eval/eval_queries.rs#L227">https://github.com/rust-lang/rust/blob/f3c923a13a458c35ee26b3513533fce8a15c9c05/compiler/rustc_mir/src/const_eval/eval_queries.rs#L227</a></p>



<a name="210506703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506703">(Sep 18 2020 at 11:37)</a>:</h4>
<p>This would be the first step. As a next step we'd have to replicate the logic for finding all allocations mentioned by that root allocation and also print those. But we can do that in a separate PR</p>



<a name="210506725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506725">(Sep 18 2020 at 11:37)</a>:</h4>
<p>This PR will cause lots of ui test changes already <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span></p>



<a name="210506812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210506812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210506812">(Sep 18 2020 at 11:38)</a>:</h4>
<p>Thanks for digging into this! This approach seems quite doable.</p>



<a name="210507059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210507059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210507059">(Sep 18 2020 at 11:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="256313">Hameer Abbasi</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Looking.20for.20help.20on.20.2353325/near/210506290">said</a>:</p>
<blockquote>
<p>The issue. Or would you recommend adding a <code>Pointer</code>/<code>Option&lt;Pointer&gt;</code>?</p>
</blockquote>
<p>yeah I think <code>Option&lt;Pointer&gt;</code> seems fine, then we can use the information whenever we have it</p>



<a name="210523325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210523325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210523325">(Sep 18 2020 at 14:08)</a>:</h4>
<p>PR is up: <a href="https://github.com/rust-lang/rust/pull/76881">https://github.com/rust-lang/rust/pull/76881</a></p>



<a name="210653314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210653314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210653314">(Sep 20 2020 at 07:04)</a>:</h4>
<p>Hello. In the above-mentioned PR I'm having trouble normalising the output to something that doensn't break on 32-bit systems. I've tried a few regex variants, for example</p>
<div class="codehilite"><pre><span></span><code>// normalize-stderr-test &quot;\(size: [0-9]+, align: [0-9]+\) {[\s\S]*}&quot;-&gt;&quot;(size: XX, align: YY) {...}&quot;
</code></pre></div>


<p>which works <a href="http://regexr.com/5cd1d">here</a> but doesn't in the comment, raising the error:</p>
<p><code>error: repetition quantifier expects a valid decimal</code></p>
<p>cc <span class="user-mention" data-user-id="222471">@BurntSushi</span></p>



<a name="210653514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210653514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210653514">(Sep 20 2020 at 07:10)</a>:</h4>
<p>IIUC, the <code>rust-regex</code> library is _always_ treating <code>*</code> as a repetition quantifier, when it can match characters as well. Is this a known bug?</p>



<a name="210654027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210654027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210654027">(Sep 20 2020 at 07:29)</a>:</h4>
<p>doesn't the following work? <code>\*</code></p>



<a name="210654117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210654117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210654117">(Sep 20 2020 at 07:31)</a>:</h4>
<p>I believe that's for the literal <code>*</code> character, not matching any string, which is what I'd like to do here. In any case, it doesn't work:</p>
<div class="codehilite"><pre><span></span><code>regex parse error:
    \(size: [0-9]+, align: [0-9]+\) {[\s\S]\*}
                                     ^
error: repetition quantifier expects a valid decimal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)&#39;, src/tools/compiletest/src/runtest.rs:3388:42
</code></pre></div>



<a name="210654382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210654382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210654382">(Sep 20 2020 at 07:40)</a>:</h4>
<p>I am really not using regex enough to be too helpful here <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> what prevents you from using  .* instead of  <code>{[\s\S]\*}</code>?</p>
<p>Or more naively, how do curly braces work in regex?</p>



<a name="210654497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210654497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210654497">(Sep 20 2020 at 07:43)</a>:</h4>
<p>oh... I don't know if these things can do multi-line processing</p>



<a name="210654541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210654541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210654541">(Sep 20 2020 at 07:45)</a>:</h4>
<p>One thing is that you need to escape the <code>\{</code> I think</p>



<a name="210654544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210654544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210654544">(Sep 20 2020 at 07:45)</a>:</h4>
<p>another is that  you can try using <code>[^\}]*</code> as a pattern</p>



<a name="210654602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210654602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210654602">(Sep 20 2020 at 07:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Looking.20for.20help.20on.20.2353325/near/210654497">said</a>:</p>
<blockquote>
<p>oh... I don't know if these things can do multi-line processing</p>
</blockquote>
<p>They can't naïvely. Maybe there's an option though.</p>
<p>/me digs furiously into code</p>



<a name="210655573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210655573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210655573">(Sep 20 2020 at 08:16)</a>:</h4>
<p>Alternatively we can teach compiletest something to handle this specific case. Like where we specifiy a start and end pattern (in our case the end pattern is <code>^\w*\}\w*$</code> I think?)</p>



<a name="210655584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210655584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210655584">(Sep 20 2020 at 08:17)</a>:</h4>
<p>so it would just skip all lines after the first pattern until it encounters the second pattern</p>



<a name="210655586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210655586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210655586">(Sep 20 2020 at 08:17)</a>:</h4>
<p>what do you think about that?</p>



<a name="210655763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210655763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210655763">(Sep 20 2020 at 08:22)</a>:</h4>
<p>I could do that; where in compiletest would I have to touch?</p>



<a name="210655824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210655824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210655824">(Sep 20 2020 at 08:24)</a>:</h4>
<p>grep for <code>normalize-stderr-test</code> in the source of compiletest, I can give you more info in an hour, breakfast time</p>



<a name="210656677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210656677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210656677">(Sep 20 2020 at 08:52)</a>:</h4>
<p>hmm... this is all not fun</p>



<a name="210656684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210656684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210656684">(Sep 20 2020 at 08:52)</a>:</h4>
<p>maybe we need something like the 32/64 bit difference for mir-opt tests, so we'd get two files, one per bit size</p>



<a name="210656690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210656690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210656690">(Sep 20 2020 at 08:53)</a>:</h4>
<p>I wonder if we should just do an MCP and see how everyone likes it</p>



<a name="210656891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210656891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210656891">(Sep 20 2020 at 08:59)</a>:</h4>
<p>and done: <a href="https://github.com/rust-lang/compiler-team/issues/365">https://github.com/rust-lang/compiler-team/issues/365</a></p>



<a name="210656901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210656901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210656901">(Sep 20 2020 at 08:59)</a>:</h4>
<p>It'd be hard to generate/modify such test expects if not on a target machine.</p>



<a name="210656979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210656979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210656979">(Sep 20 2020 at 09:01)</a>:</h4>
<p>The following regex-s seem to work:</p>
<div class="codehilite"><pre><span></span><code>// normalize-stderr-test &quot;\(size: [0-9]+, align: [0-9]+\)&quot; -&gt; &quot;(size: XX, align: YY)&quot;
// normalize-stderr-test &quot;╾.*╼&quot; -&gt; &quot;...&quot;
// normalize-stderr-test &quot;([0-9_][0-9_] ){4,}.*[.|░]&quot; -&gt; &quot;...&quot;
</code></pre></div>


<p>But they're flaky.</p>



<a name="210657121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210657121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210657121">(Sep 20 2020 at 09:06)</a>:</h4>
<p>Oh, you already covered that in your MCP. Well, I'm thinking of macOS where running 32-bit binaries on Catalina+ is forbidden.</p>



<a name="210657699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210657699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210657699">(Sep 20 2020 at 09:23)</a>:</h4>
<p>you can just run tests against the 32 bit version of your own platform. I frequently run with <code>--target i686-unknown-linux-gnu</code></p>



<a name="210657744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210657744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210657744">(Sep 20 2020 at 09:24)</a>:</h4>
<p>you don't need to <em>run</em> any binaries, that's the beauty</p>



<a name="210657749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210657749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210657749">(Sep 20 2020 at 09:24)</a>:</h4>
<p>you just need to build them</p>



<a name="210657753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210657753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210657753">(Sep 20 2020 at 09:24)</a>:</h4>
<p>I mean, most likey you can just cross compile for <code>i686-unknown-linux-gnu</code></p>



<a name="210657769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210657769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210657769">(Sep 20 2020 at 09:25)</a>:</h4>
<p>yea, that test is going to be flaky because the number of lines will differ, too. You can try just removing the entire line that contains such a fragment</p>



<a name="210657775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210657775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210657775">(Sep 20 2020 at 09:25)</a>:</h4>
<p>but in that case, we're not really testing the output anymore <span aria-label="frown" class="emoji emoji-1f641" role="img" title="frown">:frown:</span></p>



<a name="210684966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210684966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210684966">(Sep 20 2020 at 20:55)</a>:</h4>
<p><span class="user-mention" data-user-id="256313">@Hameer Abbasi</span> The problem with your regex is that you're using a <em>repetition quantifier</em> (that's the <code>{m,n}</code> or <code>{m}</code> syntax) as a literal, but you aren't escaping it. so use <code>\{</code> and <code>\}</code> to match literal braces.</p>



<a name="210714764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210714764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210714764">(Sep 21 2020 at 08:50)</a>:</h4>
<p>This is the key piece, I think, and the answer for my question.</p>
<p>I see the MCP got no traction so far.</p>



<a name="210715980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210715980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210715980">(Sep 21 2020 at 09:05)</a>:</h4>
<p>yea, I already mentioned that these need to be escaped earlier, I should have pushed more on that end. But I don't know if this helps, because I don't know if we support multi-line replacements</p>



<a name="210715992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210715992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210715992">(Sep 21 2020 at 09:05)</a>:</h4>
<p>The MCP won't do anything before thursday I think</p>



<a name="210716285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210716285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210716285">(Sep 21 2020 at 09:08)</a>:</h4>
<p>&lt;ignore me&gt;</p>



<a name="210716445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210716445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210716445">(Sep 21 2020 at 09:10)</a>:</h4>
<p><span class="user-mention" data-user-id="119581">@mati865</span> wrong stream and topic?</p>



<a name="210716607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Looking%20for%20help%20on%20%2353325/near/210716607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Looking.20for.20help.20on.20.2353325.html#210716607">(Sep 21 2020 at 09:10)</a>:</h4>
<p>Sorry, accidentality hit arrow too many times <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>